<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<title>Document</title>
	<style>
		.delete { 
			display: none; 
			color: red;
		}

		.cfirm {
			width: 200px;
			height: 50px;
			border: 1px solid #333;
			background-color: #fff;
			position: absolute;
			top: 50%;
            margin-top: -75px;
        	left: 50%;
        	margin-left: -100px;
        	display: none;
		}

		#que {
			width: 45px;
			height: 20px;
			border: 1px solid red;
			border-radius: 3px;
			color: #fff;
			text-align: center;
			line-height: 20px;
			background-color: red;
			position: absolute;
			right: 5px;
			bottom: 5px;
			cursor: pointer;
		}

		#qu {
			width: 45px;
			height: 20px;
			border: 1px solid green;
			border-radius: 3px;
			color: #fff;
			text-align: center;
			line-height: 20px;
			background-color: green;
			position: absolute;
			right: 55px;
			bottom: 5px;
			cursor: pointer;
		}

		
	</style>

</head>
<body>
	<span data-from="0" data-to="750" data-speed="1000" data-refresh-interval="20">750</span>
	<div class="cfirm">
		你确定要删除该内容？
		<span id="que">确定</span>
		<span id="qu">取消</span>
	</div>
	
	<ul id=items>
	    <li>List item 1 <span class=delete>删除</span></li>
	    <li>List item 2 <span class=delete>删除</span></li>
	</ul>
	
	<script src="../lib/zepto.min.js"></script>
	<script>
		// show delete buttons on swipe
		$('#items li').on('touchmove',function(e){
		  var ev = e||event;
		  e.preventDefault();
		  $('.delete').hide();
		  $('.delete', this).show();
		})		

		
		$('.delete').on('touchstart',function(){
			$('.delete').hide();
			$('.cfirm').show();	
		});

		$('#que').on('touchstart',function() {	
			
		});
	

		$('#qu').on('touchstart',function() {
			$('.cfirm').hide();
		});




	/*var cutStr=function(str){  

	  var newStr=new Array(str.length+parseInt(str.length/3));   
	  var strArray=str.split("");
	  newStr[newStr.length-1]=strArray[strArray.length-1];   
	  var currentIndex=strArray.length-1;   
	  for (var index = newStr.length - 1; index >= 0; index--) {
	    if ((newStr.length - index) % 4 == 0) {
	      newStr[index] = ",";
	    } else{   
	      newStr[index] = strArray[currentIndex--];
	    }   
	  }   
	  return newStr.join("")  
	 
	}  
	var num=34859560968872; 
	alert(cutStr(num+""));*/

	 /*var   num = "1232134456";
	 alert(parseFloat(num).toLocaleString());*/

	 var cut = function(str) {
	 	var num = parseFloat(str).toLocaleString();
	 	return num;
	 };

	 console.log(cut('98767884733234567'))


	console.log(parseFloat(56623434235));
	console.log(parseInt('3.14rdf159345664'));


	var d = new Date;
	console.log(d.toLocaleString())
	 

	/* function format_number(n){  
	   var b=parseInt(n).toString();  
	   var len=b.length;  
	   if(len<=3){return b;}  
	   var r=len%3;  
	   return r>0?b.slice(0,r)+","+b.slice(r,len).match(/\d{3}/g).join(","):b.slice(r,len).match(/\d{3}/g).join(",");  
	 }  
	  
	var a="53669988.000";  
	alert(format_number(a));  */
	 
	</script>
</body>
</html>